//返回顶部
var top1 = document.querySelector("#top");
window.onscroll = function(){
    if (document.body.scrollTop > 1000){
        top1.style.display = 'block';
    } else{
        top1.style.display = 'none';
    }
};
top1.addEventListener('click',function(){
    window.scrollTo(0,0);
});
//分类按钮
var inner1 = document.querySelector("#inner");
var outside1 = document.querySelector("#outside");
inner1.addEventListener('mouseover',function(){
   outside1.style.display = 'block';
});
inner1.addEventListener('mouseleave',function(){
    outside1.style.display = 'none';
});
outside1.addEventListener('mouseover',function(){
    outside1.style.display = 'block';
});
outside1.addEventListener('mouseleave',function(){
    outside1.style.display = 'none';
});
//点赞
var fish = document.querySelector("#fish");
var span = document.querySelector("#span").innerHTML;
span = Number(span);
    fish.addEventListener('click', function(){
        if(document.querySelector("#span").innerHTML == span){
            document.querySelector("#span").innerHTML = span + 1;
        }else {
            document.querySelector("#span").innerHTML = span;
        }
    });
var mySwiper = new Swiper ('.swiper-container', {

    loop: true, // 循环模式选项

    // 如果需要分页器
    pagination: {
        el: '.swiper-pagination'
    },

    // 如果需要前进后退按钮
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev'
    }
});